home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / IntlResources.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  13.4 KB  |  359 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        IntlResources.p
  3.  
  4.      Contains:    International Resource definitions.
  5.  
  6.      Version:    Technology:    System 7.5+
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1983-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT IntlResources;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __INTLRESOURCES__}
  28. {$SETC __INTLRESOURCES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC IntlResourcesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37.  
  38.  
  39. {$PUSH}
  40. {$ALIGN MAC68K}
  41. {$LibExport+}
  42.  
  43.  
  44. CONST
  45.                                                                 {  Bits in the itlcFlags byte  }
  46.     itlcShowIcon                = 7;                            { Show icon even if only one script }
  47.     itlcDualCaret                = 6;                            { Use dual caret for mixed direction text }
  48.                                                                 {  Bits in the itlcSysFlags word  }
  49.     itlcSysDirection            = 15;                            { System direction - left to right/right to left }
  50.  
  51.     tokLeftQuote                = 1;                            {  NumberParts.data[] enumerators                                              }
  52.     tokRightQuote                = 2;                            {   In general, these are NOT to be considered indices into the data[] array  }
  53.     tokLeadPlacer                = 3;
  54.     tokLeader                    = 4;
  55.     tokNonLeader                = 5;
  56.     tokZeroLead                    = 6;
  57.     tokPercent                    = 7;
  58.     tokPlusSign                    = 8;
  59.     tokMinusSign                = 9;
  60.     tokThousands                = 10;
  61.     tokReserved                    = 11;                            {  11 is reserved field  }
  62.     tokSeparator                = 12;
  63.     tokEscape                    = 13;
  64.     tokDecPoint                    = 14;
  65.     tokEPlus                    = 15;
  66.     tokEMinus                    = 16;
  67.     tokMaxSymbols                = 31;
  68.     curNumberPartsVersion        = 1;                            { current version of NumberParts record }
  69.  
  70.     currSymLead                    = 16;
  71.     currNegSym                    = 32;
  72.     currTrailingZ                = 64;
  73.     currLeadingZ                = 128;
  74.  
  75.     mdy                            = 0;
  76.     dmy                            = 1;
  77.     ymd                            = 2;
  78.     myd                            = 3;
  79.     dym                            = 4;
  80.     ydm                            = 5;
  81.  
  82.  
  83. TYPE
  84.     DateOrders                            = SInt8;
  85.  
  86. CONST
  87.     timeCycle24                    = 0;                            { time sequence 0:00 - 23:59 }
  88.     timeCycleZero                = 1;                            { time sequence 0:00-11:59, 0:00 - 11:59 }
  89.     timeCycle12                    = 255;                            { time sequence 12:00 - 11:59, 12:00 - 11:59 }
  90.     zeroCycle                    = 1;                            { old name for timeCycleZero }
  91.     longDay                        = 0;                            { day of the month }
  92.     longWeek                    = 1;                            { day of the week }
  93.     longMonth                    = 2;                            { month of the year }
  94.     longYear                    = 3;                            { year }
  95.     supDay                        = 1;                            { suppress day of month }
  96.     supWeek                        = 2;                            { suppress day of week }
  97.     supMonth                    = 4;                            { suppress month }
  98.     supYear                        = 8;                            { suppress year }
  99.     dayLdingZ                    = 32;
  100.     mntLdingZ                    = 64;
  101.     century                        = 128;
  102.     secLeadingZ                    = 32;
  103.     minLeadingZ                    = 64;
  104.     hrLeadingZ                    = 128;
  105.  
  106. { move OffsetTable to QuickdrawText }
  107.  
  108. TYPE
  109.     Intl0RecPtr = ^Intl0Rec;
  110.     Intl0Rec = PACKED RECORD
  111.         decimalPt:                CHAR;                                    { decimal point character }
  112.         thousSep:                CHAR;                                    { thousands separator character }
  113.         listSep:                CHAR;                                    { list separator character }
  114.         currSym1:                CHAR;                                    { currency symbol }
  115.         currSym2:                CHAR;
  116.         currSym3:                CHAR;
  117.         currFmt:                UInt8;                                    { currency format flags }
  118.         dateOrder:                UInt8;                                    { order of short date elements: mdy, dmy, etc. }
  119.         shrtDateFmt:            UInt8;                                    { format flags for each short date element }
  120.         dateSep:                CHAR;                                    { date separator character }
  121.         timeCycle:                UInt8;                                    { specifies time cycle: 0..23, 1..12, or 0..11 }
  122.         timeFmt:                UInt8;                                    { format flags for each time element }
  123.         mornStr:                PACKED ARRAY [1..4] OF CHAR;            { trailing string for AM if 12-hour cycle }
  124.         eveStr:                    PACKED ARRAY [1..4] OF CHAR;            { trailing string for PM if 12-hour cycle }
  125.         timeSep:                CHAR;                                    { time separator character }
  126.         time1Suff:                CHAR;                                    { trailing string for AM if 24-hour cycle }
  127.         time2Suff:                CHAR;
  128.         time3Suff:                CHAR;
  129.         time4Suff:                CHAR;
  130.         time5Suff:                CHAR;                                    { trailing string for PM if 24-hour cycle }
  131.         time6Suff:                CHAR;
  132.         time7Suff:                CHAR;
  133.         time8Suff:                CHAR;
  134.         metricSys:                UInt8;                                    { 255 if metric, 0 if inches etc. }
  135.         intl0Vers:                INTEGER;                                { region code (hi byte) and version (lo byte) }
  136.     END;
  137.  
  138.     Intl0Ptr                            = ^Intl0Rec;
  139.     Intl0Hndl                            = ^Intl0Ptr;
  140.     Intl1RecPtr = ^Intl1Rec;
  141.     Intl1Rec = PACKED RECORD
  142.         days:                    ARRAY [1..7] OF Str15;                    { day names }
  143.         months:                    ARRAY [1..12] OF Str15;                    { month names }
  144.         suppressDay:            UInt8;                                    { 255 for no day, or flags to suppress any element }
  145.         lngDateFmt:                UInt8;                                    { order of long date elements }
  146.         dayLeading0:            UInt8;                                    { 255 for leading 0 in day number }
  147.         abbrLen:                UInt8;                                    { length for abbreviating names }
  148.         st0:                    PACKED ARRAY [1..4] OF CHAR;            { separator strings for long date format }
  149.         st1:                    PACKED ARRAY [1..4] OF CHAR;
  150.         st2:                    PACKED ARRAY [1..4] OF CHAR;
  151.         st3:                    PACKED ARRAY [1..4] OF CHAR;
  152.         st4:                    PACKED ARRAY [1..4] OF CHAR;
  153.         intl1Vers:                INTEGER;                                { region code (hi byte) and version (lo byte) }
  154.         localRtn:                ARRAY [0..0] OF INTEGER;                { now a flag for opt extension }
  155.     END;
  156.  
  157.     Intl1Ptr                            = ^Intl1Rec;
  158.     Intl1Hndl                            = ^Intl1Ptr;
  159. {fields for optional itl1 extension}
  160.     Itl1ExtRecPtr = ^Itl1ExtRec;
  161.     Itl1ExtRec = RECORD
  162.         base:                    Intl1Rec;                                { un-extended Intl1Rec }
  163.         version:                INTEGER;
  164.         format:                    INTEGER;
  165.         calendarCode:            INTEGER;                                { calendar code for this itl1 resource }
  166.         extraDaysTableOffset:    LONGINT;                                { offset in itl1 to extra days table }
  167.         extraDaysTableLength:    LONGINT;                                { length of extra days table }
  168.         extraMonthsTableOffset:    LONGINT;                                { offset in itl1 to extra months table }
  169.         extraMonthsTableLength:    LONGINT;                                { length of extra months table }
  170.         abbrevDaysTableOffset:    LONGINT;                                { offset in itl1 to abbrev days table }
  171.         abbrevDaysTableLength:    LONGINT;                                { length of abbrev days table }
  172.         abbrevMonthsTableOffset: LONGINT;                                { offset in itl1 to abbrev months table }
  173.         abbrevMonthsTableLength: LONGINT;                                { length of abbrev months table }
  174.         extraSepsTableOffset:    LONGINT;                                { offset in itl1 to extra seps table }
  175.         extraSepsTableLength:    LONGINT;                                { length of extra seps table }
  176.         tables:                    ARRAY [0..0] OF INTEGER;                { now a flag for opt extension }
  177.     END;
  178.  
  179.     UntokenTablePtr = ^UntokenTable;
  180.     UntokenTable = RECORD
  181.         len:                    INTEGER;
  182.         lastToken:                INTEGER;
  183.         index:                    ARRAY [0..255] OF INTEGER;                { index table; last = lastToken }
  184.     END;
  185.  
  186.     UntokenTableHandle                    = ^UntokenTablePtr;
  187.     WideCharPtr = ^WideChar;
  188.     WideChar = RECORD
  189.         CASE INTEGER OF
  190.         0: (
  191.             a:                    PACKED ARRAY [0..1] OF CHAR;            { 0 is the high order character }
  192.             );
  193.         1: (
  194.             b:                    INTEGER;
  195.             );
  196.     END;
  197.  
  198.     WideCharArrPtr = ^WideCharArr;
  199.     WideCharArr = RECORD
  200.         size:                    INTEGER;
  201.         data:                    ARRAY [0..9] OF WideChar;
  202.     END;
  203.  
  204.     NumberPartsPtr = ^NumberParts;
  205.     NumberParts = RECORD
  206.         version:                INTEGER;
  207.         data:                    ARRAY [0..30] OF WideChar;                { index by [tokLeftQuote..tokMaxSymbols] }
  208.         pePlus:                    WideCharArr;
  209.         peMinus:                WideCharArr;
  210.         peMinusPlus:            WideCharArr;
  211.         altNumTable:            WideCharArr;
  212.         reserved:                PACKED ARRAY [0..19] OF CHAR;
  213.     END;
  214.  
  215.  
  216.     Itl4RecPtr = ^Itl4Rec;
  217.     Itl4Rec = RECORD
  218.         flags:                    INTEGER;                                { reserved }
  219.         resourceType:            LONGINT;                                { contains 'itl4' }
  220.         resourceNum:            INTEGER;                                { resource ID }
  221.         version:                INTEGER;                                { version number }
  222.         resHeader1:                LONGINT;                                { reserved }
  223.         resHeader2:                LONGINT;                                { reserved }
  224.         numTables:                INTEGER;                                { number of tables, one-based }
  225.         mapOffset:                LONGINT;                                { offset to table that maps byte to token }
  226.         strOffset:                LONGINT;                                { offset to routine that copies canonical string }
  227.         fetchOffset:            LONGINT;                                { offset to routine that gets next byte of character }
  228.         unTokenOffset:            LONGINT;                                { offset to table that maps token to canonical string }
  229.         defPartsOffset:            LONGINT;                                { offset to default number parts table }
  230.         resOffset6:                LONGINT;                                { reserved }
  231.         resOffset7:                LONGINT;                                { reserved }
  232.         resOffset8:                LONGINT;                                { reserved }
  233.     END;
  234.  
  235.     Itl4Ptr                                = ^Itl4Rec;
  236.     Itl4Handle                            = ^Itl4Ptr;
  237. { New NItl4Rec for System 7.0: }
  238.     NItl4RecPtr = ^NItl4Rec;
  239.     NItl4Rec = RECORD
  240.         flags:                    INTEGER;                                { reserved }
  241.         resourceType:            LONGINT;                                { contains 'itl4' }
  242.         resourceNum:            INTEGER;                                { resource ID }
  243.         version:                INTEGER;                                { version number }
  244.         format:                    INTEGER;                                { format code }
  245.         resHeader:                INTEGER;                                { reserved }
  246.         resHeader2:                LONGINT;                                { reserved }
  247.         numTables:                INTEGER;                                { number of tables, one-based }
  248.         mapOffset:                LONGINT;                                { offset to table that maps byte to token }
  249.         strOffset:                LONGINT;                                { offset to routine that copies canonical string }
  250.         fetchOffset:            LONGINT;                                { offset to routine that gets next byte of character }
  251.         unTokenOffset:            LONGINT;                                { offset to table that maps token to canonical string }
  252.         defPartsOffset:            LONGINT;                                { offset to default number parts table }
  253.         whtSpListOffset:        LONGINT;                                { offset to white space code list }
  254.         resOffset7:                LONGINT;                                { reserved }
  255.         resOffset8:                LONGINT;                                { reserved }
  256.         resLength1:                INTEGER;                                { reserved }
  257.         resLength2:                INTEGER;                                { reserved }
  258.         resLength3:                INTEGER;                                { reserved }
  259.         unTokenLength:            INTEGER;                                { length of untoken table }
  260.         defPartsLength:            INTEGER;                                { length of default number parts table }
  261.         whtSpListLength:        INTEGER;                                { length of white space code list }
  262.         resLength7:                INTEGER;                                { reserved }
  263.         resLength8:                INTEGER;                                { reserved }
  264.     END;
  265.  
  266.     NItl4Ptr                            = ^NItl4Rec;
  267.     NItl4Handle                            = ^NItl4Ptr;
  268.  
  269.     TableDirectoryRecordPtr = ^TableDirectoryRecord;
  270.     TableDirectoryRecord = RECORD
  271.         tableSignature:            OSType;                                    { 4 byte long table name  }
  272.         reserved:                UInt32;                                    { Reserved for internal use  }
  273.         tableStartOffset:        UInt32;                                    { Table start offset in byte }
  274.         tableSize:                UInt32;                                    { Table size in byte }
  275.     END;
  276.  
  277.     Itl5RecordPtr = ^Itl5Record;
  278.     Itl5Record = RECORD
  279.         versionNumber:            Fixed;                                    { itl5 resource version number  }
  280.         numberOfTables:            UInt16;                                    { Number of tables it contains  }
  281.         reserved:                ARRAY [0..2] OF UInt16;                    { Reserved for internal use  }
  282.         tableDirectory:            ARRAY [0..0] OF TableDirectoryRecord;    { Table directory records  }
  283.     END;
  284.  
  285.     RuleBasedTrslRecordPtr = ^RuleBasedTrslRecord;
  286.     RuleBasedTrslRecord = RECORD
  287.         sourceType:                INTEGER;                                { Transliterate target type for the LHS of the rule  }
  288.         targetType:                INTEGER;                                { Transliterate target type for the RHS of the rule  }
  289.         formatNumber:            INTEGER;                                { Transliterate resource format number  }
  290.         propertyFlag:            INTEGER;                                { Transliterate property flags  }
  291.         numberOfRules:            INTEGER;                                { Number of rules following this field  }
  292.     END;
  293.  
  294.  
  295.     ItlcRecordPtr = ^ItlcRecord;
  296.     ItlcRecord = RECORD
  297.         itlcSystem:                INTEGER;                                { default system script }
  298.         itlcReserved:            INTEGER;                                { reserved }
  299.         itlcFontForce:            SInt8;                                    { default font force flag }
  300.         itlcIntlForce:            SInt8;                                    { default intl force flag }
  301.         itlcOldKybd:            SInt8;                                    { MacPlus intl keybd flag }
  302.         itlcFlags:                SInt8;                                    { general flags }
  303.         itlcIconOffset:            INTEGER;                                { keyboard icon offset; not used in 7.0 }
  304.         itlcIconSide:            SInt8;                                    { keyboard icon side; not used in 7.0 }
  305.         itlcIconRsvd:            SInt8;                                    { rsvd for other icon info }
  306.         itlcRegionCode:            INTEGER;                                { preferred verXxx code }
  307.         itlcSysFlags:            INTEGER;                                { flags for setting system globals }
  308.         itlcReserved4:            ARRAY [0..31] OF SInt8;                    { for future use }
  309.     END;
  310.  
  311.     ItlbRecordPtr = ^ItlbRecord;
  312.     ItlbRecord = RECORD
  313.         itlbNumber:                INTEGER;                                { itl0 id number }
  314.         itlbDate:                INTEGER;                                { itl1 id number }
  315.         itlbSort:                INTEGER;                                { itl2 id number }
  316.         itlbFlags:                INTEGER;                                { Script flags }
  317.         itlbToken:                INTEGER;                                { itl4 id number }
  318.         itlbEncoding:            INTEGER;                                { itl5 ID # (optional; char encoding) }
  319.         itlbLang:                INTEGER;                                { current language for script  }
  320.         itlbNumRep:                SInt8;                                    { number representation code }
  321.         itlbDateRep:            SInt8;                                    { date representation code  }
  322.         itlbKeys:                INTEGER;                                { KCHR id number }
  323.         itlbIcon:                INTEGER;                                { ID # of SICN or kcs#/kcs4/kcs8 suite. }
  324.     END;
  325.  
  326. { New ItlbExtRecord structure for System 7.0 }
  327.     ItlbExtRecordPtr = ^ItlbExtRecord;
  328.     ItlbExtRecord = PACKED RECORD
  329.         base:                    ItlbRecord;                                { un-extended ItlbRecord }
  330.         itlbLocalSize:            LONGINT;                                { size of script's local record }
  331.         itlbMonoFond:            INTEGER;                                { default monospace FOND ID }
  332.         itlbMonoSize:            INTEGER;                                { default monospace font size }
  333.         itlbPrefFond:            INTEGER;                                { preferred FOND ID }
  334.         itlbPrefSize:            INTEGER;                                { preferred font size }
  335.         itlbSmallFond:            INTEGER;                                { default small FOND ID }
  336.         itlbSmallSize:            INTEGER;                                { default small font size }
  337.         itlbSysFond:            INTEGER;                                { default system FOND ID }
  338.         itlbSysSize:            INTEGER;                                { default system font size }
  339.         itlbAppFond:            INTEGER;                                { default application FOND ID }
  340.         itlbAppSize:            INTEGER;                                { default application font size }
  341.         itlbHelpFond:            INTEGER;                                { default Help Mgr FOND ID }
  342.         itlbHelpSize:            INTEGER;                                { default Help Mgr font size }
  343.         itlbValidStyles:        Style;                                    { set of valid styles for script }
  344.         itlbAliasStyle:            Style;                                    { style (set) to mark aliases }
  345.     END;
  346.  
  347.  
  348.  
  349. {$ALIGN RESET}
  350. {$POP}
  351.  
  352. {$SETC UsingIncludes := IntlResourcesIncludes}
  353.  
  354. {$ENDC} {__INTLRESOURCES__}
  355.  
  356. {$IFC NOT UsingIncludes}
  357.  END.
  358. {$ENDC}
  359.